home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_truckenter.cog < prev    next >
Text File  |  1999-11-15  |  6KB  |  196 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 01_BAB_TruckEnter.cog
  4. #
  5. #
  6. # [SXC]
  7. #
  8. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  9. #
  10. # ===================================================================
  11.  
  12. symbols
  13.  
  14.     # ************************ MESSAGES ************************
  15.  
  16.     message        startup
  17.     message     entered
  18.     message        crossed
  19.     
  20.     # ************************ KEYFRAMES ***********************
  21.     
  22.     keyframe    in_kneel=in_stand_bd_crawl.key            local
  23.     keyframe    in_standUp=0in_crawl_bd_stand.key        local
  24.        
  25.     # ************************* SOUNDS *************************
  26.     
  27.     sound       bodyhit=fol_bodyfall_fall.wav           local
  28.     sound       introuble=inxj011.wav                   local
  29.     sound       indymusic=mus_gen_indy_a_theme1.wav     local
  30.     
  31.     # ************************* THINGS *************************
  32.  
  33.     thing        player                                    local
  34.     thing       actorindy
  35.     thing       babtruck                                
  36.     thing       spintarget
  37.     thing       swingpos
  38.     thing       teleport_pos
  39.     thing       invisitruck
  40.     
  41.     cog         enemytargetcog
  42.     cog         truckmovecog
  43.     
  44.     surface     scene_triggerface
  45.     surface     crosface0                               mask=0x004
  46.     surface     crosface1                               mask=0x004
  47.     
  48.     # Cameras
  49.     
  50.     thing       cam0_exterior
  51.     thing       cam0_interior
  52.     thing       cam1_interior
  53.     thing       safepos0
  54.                             
  55.     # *********************** VARIABLES ***********************
  56.     
  57.     int         got_in=0                                local
  58.     int         cogstarted=0                            local
  59.     int         in_keytrack1                            local
  60.             
  61. end
  62.                     
  63. # ===================================================================
  64.  
  65. code
  66.  
  67. # -------------------------------------------------------------------
  68. startup:
  69.  
  70.     # Pointer to Player
  71.     player = GetLocalPlayerThing();
  72.     
  73. return;
  74.  
  75. # -------------------------------------------------------------------
  76. crossed:
  77.  
  78.     if ((GetSenderRef() == scene_triggerface) && (cogstarted == 0))
  79.     {
  80.         //attach a ghost to the truck to teleport actor to
  81.         //truck is made visible in BAB_Truckmove
  82.         cogstarted = 1;
  83.         Sleep(1);
  84.         AttachThingToThingEx(teleport_pos, babtruck, 0x000C);
  85.         AttachThingToThingEx(invisitruck, babtruck, 0x000C);
  86.         SetThingFlags(teleport_pos, 0x10);
  87.         //print("thing attached to truck");
  88.     }
  89.     
  90.     //Switch to interior camera as truck crossed external adjoin
  91.     if ((GetSenderRef() == crosface0) &&
  92.         (GetSourceRef() == babtruck) &&
  93.         (got_in == 1) && 
  94.         (cogstarted == 1))
  95.     {
  96.         //print("truck has gone inside");
  97.         got_in=2;
  98.         //set up interior camera cut to watch him run in
  99.         SetCameraFocus(2, cam0_interior);
  100.         SetCurrentCamera(2);
  101.         SetCameraFOV(60, 1, 2.5);
  102.         
  103.     }
  104.     
  105.     //when stop face is entered stand actor up and return control
  106.     if ((GetSenderRef() == crosface1) && 
  107.         (GetSourceRef() == babtruck) && 
  108.         (got_in == 2) && 
  109.         (cogstarted == 1))
  110.     {
  111.         //print("truck has hit side door");
  112.         got_in=3;
  113.         //cut to closer shot as indy stands up
  114.         Sleep(1);
  115.         SetCameraFocus(2, cam1_interior);
  116.         SetCurrentCamera(2);
  117.         SetCameraFOV(60, 0, 0);
  118.         
  119.         //stand indy up
  120.         //DetachThing(actorindy);
  121.         PlayKey(actorindy, in_standUp, 6, 0x12, 1);
  122.         StopKey(actorindy, in_keytrack1, 0);
  123.         StopThing(actorindy);
  124.         
  125.         //turn him around
  126.         AISetLookThing(actorindy, spintarget);
  127.         Sleep(2);
  128.         
  129.         //finish cutscene
  130.         SetCollideType(babtruck, 0);
  131.         SetCollideType(teleport_pos, 0);
  132.         Sleep(0.1);
  133.         TeleportThing(player, actorindy);
  134.         //CopyOrientandPos(actorindy, player);
  135.         SetThingFlags(actorindy, 0x80000);
  136.         SetCurrentCamera(1);
  137.         SetCameraFOV(90, 0, 0);
  138.         EndCutscene();
  139.         PlayVoice(player, introuble, 1, 1);
  140.         ClearActorFlags(player, 0x200000);
  141.         Sleep(3);
  142.         SendMessage(enemytargetcog, user1);
  143.     }
  144.     
  145. return;
  146.     
  147. # -------------------------------------------------------------------
  148. entered:
  149.  
  150.     //Disable player and start cutscene
  151.     If (((GetSenderRef() == babtruck) || 
  152.          (GetSenderRef() == teleport_pos) || 
  153.          (GetSenderRef() == invisitruck)) && 
  154.          (got_in == 0))
  155.     {
  156.         got_in = 1;
  157.         //print("indy entered truck");
  158.         Sleep(0.01);
  159.         if (BitTest(GetThingFlags(player), 0x202))
  160.         {
  161.             return;
  162.         }
  163.         
  164.         SetActorFlags(player, 0x200000);
  165.         StartCutscene(1);
  166.         TeleportThing(player, safepos0);
  167.         CopyPlayerHolsters(player, actorindy);
  168.         ClearThingFlags(actorindy, 0x80000);
  169.         AISetCutsceneMode(actorindy);
  170.         TeleportThing(actorindy, teleport_pos);
  171.         AttachThingToThingEx(actorindy, babtruck, 0x000C);
  172.         AISetLookThing(actorindy, spintarget);
  173.         
  174.         //set up exterior camera
  175.         SetCameraFocus(2, cam0_exterior);
  176.         SetCameraSecondaryFocus(2, actorindy);
  177.         SetCurrentCamera(2);
  178.         SetCameraFOV(70, 0, 0);
  179.         
  180.         //play landing anim
  181.         PlayMode(actorindy, 55, 0);
  182.         Sleep(1);
  183.         PlaySoundLocal(indymusic, 1, 0, 0, 0);
  184.         //play kneeling down
  185.         in_keyTrack1 = PlayKey(actorindy, in_kneel, 4, 0x14, 0);
  186.         
  187.         //tell truckmove that indy has entered truck
  188.         SendMessage(truckmovecog, user0);
  189.     }
  190.      
  191. return;
  192.  
  193. # -------------------------------------------------------------------
  194.  
  195. end
  196.